package com.lyzbbb.demo.miniapp.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * 学生实体类
 */
@Entity
@Table(name = "students")
public class Student {

    @Id
    private String id; // 学号作为主键
    
    private String name; // 学生姓名
    
    @Column(name = "birth_date") // 明确指定列名映射
    private Date birthDate; // 学生出生日期

    // 默认构造函数
    public Student() {
    }

    // 带参构造函数
    public Student(String id, String name) {
        this.id = id;
        this.name = name;
    }
    
    // 带出生日期的构造函数
    public Student(String id, String name, Date birthDate) {
        this.id = id;
        this.name = name;
        this.birthDate = birthDate;
    }

    // Getter和Setter方法
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    
    public Date getBirthDate() {
        return birthDate;
    }
    
    public void setBirthDate(Date birthDate) {
        this.birthDate = birthDate;
    }

    @Override
    public String toString() {
        return "Student{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", birthDate=" + birthDate +
                '}';
    }
} 